package it.xiuxian.personcenter.activity

import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import it.xiuxian.lib.base.ArouterAddress
import it.xiuxian.lib.base.BaseActivity
import it.xiuxian.lib.utils.LiveDataBus
import it.xiuxian.lib.utils.RxBusCode
import it.xiuxian.personcenter.R
import it.xiuxian.personcenter.databinding.PersoncenterChengzhangzhiBinding
import it.xiuxian.personcenter.presenter.ChengZhangZhiActivityPresenter
@Route(path = ArouterAddress.CHENGZHANGZHIACTIVITY)
class ChengZhangZhiActivity:BaseActivity<ChengZhangZhiActivityPresenter>() {
    @JvmField
    @Autowired
    var chengzhangzhi:String?=null
    lateinit var binding:PersoncenterChengzhangzhiBinding
    override val layoutId: Int
        get() = R.layout.personcenter_chengzhangzhi
    override val presenter: ChengZhangZhiActivityPresenter
        get() = ChengZhangZhiActivityPresenter()

    override fun initView() {
        //super.initView()
        ARouter.getInstance().inject(this)
        binding= getViewDataBinding<PersoncenterChengzhangzhiBinding>()
        binding.tvChengzhangzhi.text = chengzhangzhi
    }

    override fun initData() {
        //super.initData()
        binding.tvGongyi.setOnClickListener {
            ARouter.getInstance().build(ArouterAddress.GONGXIANACTIVITY).navigation()
        }
        binding.tvKanshipin.setOnClickListener{
            LiveDataBus.get().with(RxBusCode.KANSHIPIN).postValue(1979)
            finish()
        }
        binding.tvYaoqing.setOnClickListener {
            ARouter.getInstance().build(ArouterAddress.INVITEFRIENDSACTIVITY).navigation()
        }
        binding.tvMingxi.setOnClickListener {
            ARouter.getInstance().build(ArouterAddress.RECORDDETAILACTIVITY).navigation()
        }
        binding.cons.setOnClickListener { finish() }
    }
}